package weka.groupminers;

import java.util.Enumeration;

import weka.associations.Apriori;
import weka.associations.Associator;
import weka.core.Capabilities;
import weka.core.Instances;
import weka.core.OptionHandler;

public class AssociationGroupMiner extends AbstractGroupMiner implements OptionHandler{
	
	/**
	 * Auto generated UID
	 */
	private static final long serialVersionUID = 3625069394207039860L;
	
	private Associator associator;
	
	public AssociationGroupMiner(){
		associator = new Apriori();
	}

	@Override
	public void mineGroups(Instances data) throws Exception {
		associator.buildAssociations(data);
	}

	@Override
	public Capabilities getCapabilities() {
		return associator.getCapabilities();
	}

	@Override
	public Enumeration<?> listOptions() {
		return ((Apriori) associator).listOptions();
	}

	@Override
	public void setOptions(String[] options) throws Exception {
		((Apriori) associator).setOptions(options);
	}

	@Override
	public String[] getOptions() {
		return ((Apriori) associator).getOptions();
	}

	public String toString(){
		return associator.toString();
	}
	
}
